package structure.myBinaryTree;

import java.util.LinkedList;
import java.util.Queue;

public class test {
    public static void main(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        BTNode root = myBinaryTree.createTree();

        myBinaryTree.preOrder(root);
        System.out.println();
        myBinaryTree.inOrder(root);
        System.out.println();
        myBinaryTree.postOrder(root);
        System.out.println();

        System.out.println("树中节点个数:");
        System.out.println(myBinaryTree.size(root));
        System.out.println(myBinaryTree.size1(root));
        System.out.println("叶子节点个数:");
        System.out.println(myBinaryTree.getLeafNodeCount(root));
        System.out.println(myBinaryTree.getLeafNodeCount1(root));
        System.out.println("第k层节点个数:");
        System.out.println(myBinaryTree.getKLevelNodeCount(root, 4));
        System.out.println(myBinaryTree.getKLevelNodeCount1(root, 4));
        System.out.println("树的高度:");
        System.out.println(myBinaryTree.getHeight(root));
        System.out.println("查找特定值H:");
        System.out.println(myBinaryTree.find(root, 'H'));
        System.out.println("判断是否为完全二叉树:");
        System.out.println(myBinaryTree.isCompleteTree(root));

    }
}
